package com.example.video.util;

import android.annotation.SuppressLint;
import android.content.Context;
import android.content.SharedPreferences;

public class Preference {
	private static final String PREFERENCES_NAME="prefers_video";
	
	@SuppressLint("CommitPrefEdits")
	private static SharedPreferences.Editor getEditor(Context context)
	{
		SharedPreferences sharedPreferences=context.getSharedPreferences(PREFERENCES_NAME, Context.MODE_PRIVATE);
		SharedPreferences.Editor editor=sharedPreferences.edit();
		return editor;
	}
	private static SharedPreferences getPreferences(Context context)
	{
		return context.getSharedPreferences(PREFERENCES_NAME, Context.MODE_PRIVATE);
	}
	
	public static void saveVersionDB(Context context,String version){
		getEditor(context).putString("version", version).commit();
	}
	public static String getVersionDB(Context context){
		return getPreferences(context).getString("version", null);
	}

}
